<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>             
        <meta http-equiv="expires" content="0"></meta>
        <meta http-equiv="Cache-Control" content="no-cache"></meta>             
        <meta http-equiv="Cache-Control" content="no-cache"></meta>
        <title>.:DMES:. - Ordenes del Almacén</title>
        <link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/webStyle.css"/>
        <script type="text/javascript">
            function start() {
                PF('statusDialog').show();
            }

            function stop() {
                PF('statusDialog').hide();
            }

            window.setTimeout("storeOrderInit()", 1000);

            function hiddenCount()
            {
                var countDiv = #{scStoreOrderBean.notificationsNumber};
                if (countDiv === 0)
                {
                    document.getElementById('imageConuter').style.visibility = 'hidden';
                    document.getElementById('countIconWarning').style.visibility = 'hidden';
                }
                else
                {
                    document.getElementById('imageConuter').style.visibility = 'visible';
                    document.getElementById('countIconWarning').style.visibility = 'visible';
                }
            }
        </script>
    </h:head>
    <h:body style="background-color: #000;">
        <p:ajaxStatus onstart="PF('statusDialog').show()" oncomplete="PF('statusDialog').hide()"/>
        <p:dialog modal="true" widgetVar="statusDialog" header="Cargando..."
                  draggable="false" closable="false" resizable="false">
            <p:graphicImage value="/images/loadBar.gif"/>
        </p:dialog>
        <div>
            <p:growl autoUpdate="true" showDetail="true" life="8000" />

            <!--         Dialogo para guardar nuevas entregas en ordenes         -->
            <p:dialog id="dialogStoreRequisition" widgetVar="dialogStoreRequisition" draggable="true" 
                      closable="true"  header="Crear una Requisición" position="center top" width="800"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">

                <h:form id="formWizardRequisition" >
                    
                        <table width="98%" cellspacing="10" >
                            <tr>
                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfOrderClass" value="Clase de Recurso"/>
                                </td>
                                <td width="40%" align="left">
                                    <p:selectOneMenu id="tfOrderClass"  value="#{scStoreOrderBean.storeOrderAdd.orderClass}" 
                                                     style="width:160px; top: 6px;"
                                                     effect="puff"
                                                     height="140">
                                        <f:selectItem itemLabel="..." />
                                        <f:selectItem itemLabel="Herramientas" itemValue="Herramientas"/>
                                        <f:selectItem itemLabel="Insumos" itemValue="Insumos"/>
                                        <f:selectItem itemLabel="Productos" itemValue="Productos"/>
                                        <f:selectItem itemLabel="Repuestos y Consumibles" itemValue="Repuestos y Consumibles"/>
                                        <p:ajax listener="#{scStoreOrderBean.fillAutocompleteList()}" update="tfOrderItem,lblOrderItem,scDataTableItems"/>
                                    </p:selectOneMenu>
                                </td>

                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfOrderCreateBy" value="Creado por"/>
                                </td>
                                <td width="40%" align="left">
                                    <p:inputText    id="tfOrderCreateBy"  readonly="true"
                                                    value="#{scStoreOrderBean.sessionBean.scUser.idPerson.lastName} #{scStoreOrderBean.sessionBean.scUser.idPerson.lastName}"
                                                    />
                                </td>
                            <tr>

                            </tr>
                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfOrderItem" value="#{scStoreOrderBean.storeOrderAdd.orderClass} a agregar"
                                                    id="lblOrderItem"/>
                                </td>
                                <td>
                                    <p:autoComplete id="tfOrderItem" completeMethod="#{scStoreOrderBean.autocompleteMetod}" 
                                                    forceSelection="true" effect="explode" disabled="#{scStoreOrderBean.activeAutocomplete}"
                                                    value="#{scStoreOrderBean.itemAdd}" emptyMessage="No hay resultados" 
                                                    placeholder="Ingrese cualquier caracter"/>
                                    <p:spacer width="5"/>
                                    <p:commandButton icon="ui-icon-plus" id="btnAddItem" 
                                                     actionListener="#{scStoreOrderBean.addItemToList()}" update="tfOrderItem,scDataTableItems"/>
                                    <p:tooltip for="tfOrderItem" value="#{storeItem.amountRequired}"/>
                                </td>
                                
                            </tr>
                        </table>
                        <p:dataTable id="scDataTableItems" emptyMessage="No existe información para visualizar" 
                                     value="#{scStoreOrderBean.storeOrderAdd.storeOrderItemList}" var="storeItem"
                                     paginator="true" rows="10"
                                     pageLinks="40"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                     {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                     rowKey="#{storeItem.idItem}"
                                     liveResize="true" rowsPerPageTemplate="10,20,30" 
                                     paginatorPosition="top" 
                                     sortBy="#{storeItem.itemDescription}" >
                            <p:column headerText="Admón" width="42">
                                <center>
                                    <p:commandButton icon="ui-icon-close" id="btnDeleteItem" 
                                                     actionListener="#{scStoreOrderBean.deleteItemToList(storeItem)}"
                                                     update="scDataTableItems" >
                                        <p:tooltip for="btnDeleteItem" value="Eliminar un item de la requisición"/>
                                    </p:commandButton>
                                </center>
                            </p:column>
                            <p:column  headerText="Item" sortBy="#{storeItem.itemDescription}" id="columnItemDescription">    
                                <center>
                                    <p:outputLabel value="#{storeItem.itemDescription}" id="lblItemDescription"/>
                                    <p:tooltip for="lblItemDescription" value="#{storeItem.itemDescription}"/>
                                </center>
                            </p:column>
                            <p:column  id="columnAmountRequired" headerText="Cant. Req." sortBy="#{storeItem.amountRequired}">    
                                <center>
                                    <p:spinner value="#{storeItem.amountRequired}" id="tfAmountRequired" size="5" min="1" />
                                    <p:tooltip for="tfAmountRequired" value="#{storeItem.amountRequired}"/>
                                </center>
                            </p:column>
                        </p:dataTable>
                        <p:spacer height="10"/>
                        <div style="alignment-adjust: central; text-align: center; vertical-align: middle; width: 100%">

                            <p:spacer width="10"/>
                            <p:commandButton value="Guardar" 
                                             actionListener="#{scStoreOrderBean.createRequisition()}" 
                                             update=":formOrderStore:scDataTableStoreOrders" />
                            <p:spacer width="5"/>
                            <p:commandButton value="Cancelar" 
                                             actionListener="#{scStoreOrderBean.cancelCreateRequisition()}"/>
                            
                        </div>
                        
                    
                </h:form>
            </p:dialog> 
<!--            #####################################################################-->
            
            
            <!--         Dialogo para guardar nuevas ordenes-->
            <p:dialog id="dialogStoreOrder" widgetVar="dialogStoreOrder" draggable="true" 
                      closable="true"  header="Editar Orden" position="center top" width="800"
                      hideEffect="explode" modal="true" showEffect="explode" resizable="true">

                <h:form id="formWizardEdit" >
                    
                        <table width="98%" cellspacing="10" >
                            <tr>
                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfnumberOrder" value="No."/>
                                </td>
                                <td width="40%" align="left">
                                    <p:inputText    id="tfnumberOrder"  readonly="true"
                                                    value="OA#{scStoreOrderBean.getFormatDateGlobal('yyyyMMdd', scStoreOrderBean.storeOrderUpdate.creationDate)}#{scStoreOrderBean.storeOrderUpdate.idStoreOrder}"
                                                    />

                                </td>
                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfOrderType" value="Tipo de Orden"/>
                                </td>
                                <td width="40%" align="left">
                                    <p:inputText    id="tfOrderType"  readonly="true"
                                                    value="#{scStoreOrderBean.storeOrderUpdate.orderType}"
                                                    />
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfOrderClass" value="Clase de Recurso"/>
                                </td>
                                <td width="40%" align="left">
                                    <p:inputText    id="tfOrderClass"  readonly="true"
                                                    value="#{scStoreOrderBean.storeOrderUpdate.orderClass}"
                                                    />

                                </td>
                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfOrderRequired" value="Requerido Por"/>
                                </td>
                                <td width="40%" align="left">
                                    <p:inputText    id="tfOrderRequired"  readonly="true"
                                                    value="#{scStoreOrderBean.storeOrderUpdate.requiredBy}"
                                                    />
                                </td>
                            </tr>
                            <tr>
                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfCreationDate" value="Fecha"/>
                                </td>
                                <td width="40%" align="left">
                                    <p:inputText    id="tfCreationDate"  readonly="true"
                                                    value="#{scStoreOrderBean.getFormatDateGlobal('dd-MM-yyyy', scStoreOrderBean.storeOrderUpdate.creationDate)}"/>

                                </td>
                                <td width="10%" align="right">
                                    <p:outputLabel  for="tfOrderState" value="Estado"/>
                                </td>
                                <td width="40%" align="left">
                                    <p:inputText    id="tfOrderState"  readonly="true"
                                                    value="#{scStoreOrderBean.storeOrderUpdate.idState.description}"
                                                    />
                                </td>
                            </tr>
                            <tr style="visibility: #{scStoreOrderBean.storeOrderUpdate.idState.idState > 4?'visible':'hidden' };">
                                <td width="20%" align="right" >
                                    <p:outputLabel  for="tfCreationDate" value="Razón de Cancelación"/>
                                </td>
                                <td width="80%" align="left" colspan="3">
                                    <p:inputTextarea    id="tfReason"  readonly="true"
                                                        value="#{scStoreOrderBean.storeOrderUpdate.reasonCancellation}"/>

                                </td>
                                
                            </tr>
                        </table>
                        <p:dataTable id="scDataTableItems" draggableColumns="true" emptyMessage="No existe información para visualizar" 
                                     value="#{scStoreOrderBean.storeOrderUpdate.storeOrderItemList}" var="storeItem"
                                     paginator="true" rows="10"
                                     pageLinks="40"
                                     paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                                     {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                                     rowKey="#{storeItem.idItem}"
                                     resizableColumns="true" 
                                     liveResize="true" rowsPerPageTemplate="10,20,30" 
                                     paginatorPosition="top" 
                                     sortBy="#{storeItem.itemDescription}" >

                            <p:column  headerText="Item" sortBy="#{storeItem.itemDescription}" id="columnItemDescription">    
                                <center>
                                    <p:outputLabel value="#{storeItem.itemDescription}" id="lblItemDescription"/>
                                    <p:tooltip for="lblItemDescription" value="#{storeItem.itemDescription}"/>
                                </center>
                            </p:column>
                            <p:column  id="columnAmountRequired" headerText="Cant. Req." sortBy="#{storeItem.amountRequired}">    
                                <center>
                                    <p:outputLabel value="#{storeItem.amountRequired}" id="lblAmountRequired"/>
                                    <p:tooltip for="lblAmountRequired" value="#{storeItem.amountRequired}"/>
                                </center>
                            </p:column>
                            <p:column  id="columnAmountStock" headerText="Stock" sortBy="#{storeItem.amountStore}">    
                                <center>
                                    <p:outputLabel value="#{storeItem.amountStore}" id="lblAmountStock"/>
                                    <p:tooltip for="lblAmountStock" value="#{storeItem.amountStore}"/>
                                </center>
                            </p:column>
                            <p:column  id="columnAmountDelivery" headerText="Cant. Ent." sortBy="#{storeItem.amountDelivery}">    
                                <center>  
                                    <p:spinner value="#{storeItem.amountDelivery}" id="lblAmountDelivery" size="5" 
                                               min="#{(storeItem.amountRequired - storeItem.amountPendingHidden)}"
                                               max ="#{(storeItem.amountRequired+1)}"
                                               disabled="#{scStoreOrderBean.isDisable(scStoreOrderBean.storeOrderUpdate.idState.idState)}">
                                        <p:ajax update="scDataTableItems" process="@this" listener="#{scStoreOrderBean.compare(storeItem)}"/>
                                    </p:spinner>
                                    <p:tooltip for="lblAmountDelivery" value="#{storeItem.amountDelivery}"/>
                                </center>
                            </p:column>
                            <p:column  id="columnAmountPending" headerText="Cant. Pen." sortBy="#{storeItem.amountPending}">    
                                <center>
                                    <p:outputLabel value="#{storeItem.amountPending}" id="lblAmountPending"/>
                                    <p:tooltip for="lblAmountPending" value="#{storeItem.amountPending}"/>
                                </center>
                            </p:column>
                            <p:column  id="columnOk" headerText="Ok" width="25" disabledSelection="true" >    
                                <center>
                                    <p:selectBooleanCheckbox value="#{storeItem.complete}"  disabled="true" id="checkOk"/>
                                    <p:tooltip for="checkOk" value="Item entregado" />
                                </center>
                            </p:column>
                        </p:dataTable>
                        <p:spacer height="10"/>
                        <div style="alignment-adjust: central; text-align: center; vertical-align: middle; width: 100%">
                            <p:commandButton value="Guardar Orden" oncomplete="PF('dlgConfirmation').show()" 
                                             disabled="#{scStoreOrderBean.isDisable(scStoreOrderBean.storeOrderUpdate.idState.idState)}"/>
                            <p:spacer width="10"/>
                            <p:commandButton value="Cancelar Orden" oncomplete="PF('dlgCancelation').show()" update=":formDialogoCancellation"
                                             disabled="#{scStoreOrderBean.isDisable(scStoreOrderBean.storeOrderUpdate.idState.idState)}"
                                              />
                            <p:spacer width="10"/>
                            <p:commandButton value="Cerrar" oncomplete="PF('dialogStoreOrder').hide()"/>
                        </div>
                        
                    
                </h:form>
            </p:dialog>
            <!--         finaliza el dialogo para nuevas ordenes-->
            <p:dialog id="dlgCancelation" widgetVar="dlgCancelation"
                      closable="false" closeOnEscape="true" draggable="true" header="Cancelación" hideEffect="explode"
                      modal="true" position="center top" resizable="false" showEffect="explode" width="300" 
                      style="text-align: center; vertical-align: middle;">
                <h:form id="formDialogoCancellation">
                    <p:outputLabel value="Ingrese el Motivo de la Cancelación"/>
                    <br/><br/>
                    <p:inputTextarea autoResize="true" counter="lblArea" label="Motivo de Cancelación" rows="4" maxlength="300" 
                                     value="#{scStoreOrderBean.storeOrderUpdate.reasonCancellation}"
                                     counterTemplate="{0} caracteres restantes." required="yes" requiredMessage="Debe ingresar un motivo de cancelación"/>
                    <br/><br/>
                    <p:outputLabel id="lblArea"/>
                    <br/><br/>
                    <p:spacer height="20"/>
                    <div style="alignment-adjust: central; text-align: center; vertical-align: middle; width: 100%">
                        <p:commandButton value="Guardar" oncomplete="PF('dlgCancelation').hide();PF('dialogStoreOrder').hide();"
                                         actionListener="#{scStoreOrderBean.cancelOrderStore(scStoreOrderBean.storeOrderUpdate)}" 
                                         update=":formOrderStore:scDataTableStoreOrders"/>
                        <p:spacer width="10"/>
                        <p:commandButton value="Salir" oncomplete="PF('dlgCancelation').hide()"/>
                    </div>   
                </h:form>
            </p:dialog>
            <p:dialog id="dlgConfirmation" widgetVar="dlgConfirmation" style="text-align: center; vertical-align: middle;"
                      closable="false" closeOnEscape="true" draggable="true" header="Confirmación" hideEffect="explode"
                      modal="true" position="center top" resizable="false" showEffect="explode">
                    <p:outputLabel value="¿Desea guardar los cambios en la orden?"/>
                    <p:spacer height="20"/>
                    <br/><br/>
                    <div style="alignment-adjust: central; text-align: center; vertical-align: middle; width: 100%">
                            <p:commandButton value="Aceptar" oncomplete="PF('dlgConfirmation').hide();PF('dialogStoreOrder').hide();"
                                             actionListener="#{scStoreOrderBean.saveOrderStore(scStoreOrderBean.storeOrderUpdate)}" update=":formOrderStore:scDataTableStoreOrders"/>
                            <p:spacer width="10"/>
                            <p:commandButton value="Cancelar" oncomplete="PF('dlgConfirmation').hide()"/>
                        </div>   
            </p:dialog>
            <!--            ######################################################################-->
            <h:form id="formOrderStore">
                <p:panel style="width: 99%;" toggleable="true" header="Ordenes del Almacén"
                         toggleOrientation="vertical" toggleTitle="Reduzca el tamaño de este menú">
                    <table width="100%" style="color: #FFF;">
                        <tr>
                            <td align="right">
                                <p:outputLabel value="Fecha Inicial:" for="initDate"/>
                            </td>
                            <td align="left">
                                <p:calendar value="#{scStoreOrderBean.initDate}" autocomplete="true" effect="explode" id="initDate" pattern="dd-MM-yyyy" 
                                            title="Ingrese la fecha inicial del rango que desea consultar" mask="true">
                                    <p:ajax listener="#{scStoreOrderBean.compareToDates()}" event="dateSelect" update="initDate, endDate"/>
                                </p:calendar>
                            </td>
                            <td align="right">
                                <p:outputLabel value="Fecha Final:" for="endDate"/>
                            </td>
                            <td align="left">
                                <p:calendar value="#{scStoreOrderBean.endDate}" autocomplete="true" effect="explode" id="endDate" pattern="dd-MM-yyyy" 
                                            title="Ingrese la fecha final del rango que desea consultar" mask="true" >
                                    <p:ajax listener="#{scStoreOrderBean.compareToDates()}" event="dateSelect" update="initDate, endDate"/>
                                </p:calendar>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <p:outputLabel value="Tipo de Orden:" for="cbOrderType"/>
                            </td>
                            <td align="left">
                                <p:selectOneMenu id="cbOrderType" value="#{scStoreOrderBean.filterOrderType}" 
                                                 style="width: 160px; top: 6px;"
                                                 effect="puff"
                                                 height="140">
                                    <f:selectItem itemLabel="..." />
                                    <f:selectItem itemLabel="Entrega" itemValue="Entrega"/>
                                    <f:selectItem itemLabel="Ingreso" itemValue="Ingreso"/>
                                </p:selectOneMenu>
                            </td>
                            <td align="right">
                                <p:outputLabel value="Clase de Recurso:" for="cbOrderClass"/>
                            </td>
                            <td align="left">
                                <p:selectOneMenu id="cbOrderClass"  value="#{scStoreOrderBean.filterOrderClass}" 
                                                 style="width:160px; top: 6px;"
                                                 effect="puff"
                                                 height="140">
                                    <f:selectItem itemLabel="..." />
                                    <f:selectItem itemLabel="Herramientas" itemValue="Herramientas"/>
                                    <f:selectItem itemLabel="Insumos" itemValue="Insumos"/>
                                    <f:selectItem itemLabel="Productos" itemValue="Productos"/>
                                    <f:selectItem itemLabel="Repuestos y Consumibles" itemValue="Repuestos y Consumibles"/>
                                </p:selectOneMenu>
                            </td>
                        </tr><tr>
                            <td align="right">
                                <p:outputLabel value="Requerido Por:" for="cbOrderRequired"/>
                            </td>
                            <td align="left">
                                <p:selectOneMenu id="cbOrderRequired"  value="#{scStoreOrderBean.filterOrderRequired}" 
                                                 style="width: 160px; top: 6px;"
                                                 effect="puff"
                                                 height="140">
                                    <f:selectItem itemLabel="..." />
                                    <f:selectItem itemLabel="Mantenimiento" itemValue="Mantenimiento"/>
                                    <f:selectItem itemLabel="Producción" itemValue="Producción"/>
                                </p:selectOneMenu>
                            </td>
                            <td align="right">
                                <p:outputLabel value="Estado:" for="cbOrderState"/>
                            </td>
                            <td align="left">
                                <p:selectOneMenu id="cbOrderState"  value="#{scStoreOrderBean.filterOrderState}" 
                                                 style="width: 160px; top: 6px;"
                                                 effect="puff"
                                                 height="140">
                                    <f:selectItem itemLabel="..." />
                                    <f:selectItems value="#{scStoreOrderBean.listStoreOrderState}" var="states" itemLabel="#{states.description}" itemValue="#{states.description}"/>

                                </p:selectOneMenu>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="right">
                                <p:commandButton value="Buscar" actionListener="#{scStoreOrderBean.doSearchWithParameters()}" 
                                                 update="scDataTableStoreOrders"/>
                            </td>
                            <td colspan="2" align="left">
                                <p:commandButton value="Limpiar" actionListener="#{scStoreOrderBean.resetData()}" 
                                                 update="scDataTableStoreOrders,initDate,endDate,cbOrderType,cbOrderClass,cbOrderRequired,cbOrderState"/>
                            </td>
                        </tr>
                    </table>
                </p:panel>

                <p:remoteCommand name="storeOrderInit" update=":formOrderStore:scDataTableStoreOrders" oncomplete="hiddenCount()"/>
                <p:dataTable id="scDataTableStoreOrders" draggableColumns="true" emptyMessage="No existe información para visualizar" 
                             value="#{scStoreOrderBean.storeOrderList}" var="storeOrder"
                             paginator="true" rows="10"  
                             pageLinks="40"
                             paginatorTemplate="{CurrentPageReport}  {FirstPageLink} 
                             {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             rowKey="#{storeOrder.idStoreOrder}"
                             resizableColumns="true" 
                             liveResize="true" rowsPerPageTemplate="10,20,30" 
                             selectionMode="single" paginatorPosition="top" selection="#{scStoreOrderBean.storeOrderUpdate}"
                             sortBy="OA#{scStoreOrderBean.getFormatDateGlobal('yyyyMMdd', storeOrder.creationDate)}#{storeOrder.idStoreOrder}"
                             rowStyleClass="#{scStoreOrderBean.getStyleRow(storeOrder)}"
                             >
                    <p:ajax event="rowSelect" listener="#{scStoreOrderBean.updateStoreOrderSelected()}" 
                            update=":formWizardEdit" oncomplete="PF('dialogStoreOrder').show()"/>
                    <f:facet name="header">
                        <div id="imageConuter" >
                            <p:graphicImage value="/images/siren.png" class="iconWarning" width="20" height="20" id="alertSiren" onclick="storeOrderInit()"/>
                            <div class="countIconWarning" id="countIconWarning" >#{scStoreOrderBean.notificationsNumber}</div>
                            <p:tooltip for="alertSiren" value="#{scStoreOrderBean.notificatonsMessage}"/>
                        </div>
                    </f:facet>
                    <f:facet name="header">
                        <p:commandButton icon="ui-icon-plus" id="btnAdd" update=":formWizardRequisition"
                                         oncomplete="PF('dialogStoreRequisition').show()" style="float: left;"/>
                    </f:facet>
                 
                    <p:column filterMatchMode="contains"  filterBy="OA#{scStoreOrderBean.getFormatDateGlobal('yyyyMMdd', storeOrder.creationDate)}#{storeOrder.idStoreOrder}"
                              id="columnOrderId" headerText="No." 
                              sortBy="OA#{scStoreOrderBean.getFormatDateGlobal('yyyyMMdd', storeOrder.creationDate)}#{storeOrder.idStoreOrder}">    
                        <center>
                            <p:outputLabel 
                                value="OA#{scStoreOrderBean.getFormatDateGlobal('yyyyMMdd', storeOrder.creationDate)}#{storeOrder.idStoreOrder}"
                                id="lblOrderId"/>
                            <p:tooltip for="lblOrderId" 
                                       value="OA#{scStoreOrderBean.getFormatDateGlobal('yyyyMMdd', storeOrder.creationDate)}#{storeOrder.idStoreOrder}"/>
                        </center>
                    </p:column>
                    <p:column  headerText="Tipo de Orden" sortBy="#{storeOrder.orderType}" id="columnTypeOrder">    
                        <center>
                            <p:outputLabel value="#{storeOrder.orderType}" id="lblOrderType"/>
                            <p:tooltip for="lblOrderType" value="#{storeOrder.orderType}"/>
                        </center>
                    </p:column>
                    <p:column  id="columnOrderClass" headerText="Clase de Recurso" sortBy="#{storeOrder.orderClass}">    
                        <center>
                            <p:outputLabel value="#{storeOrder.orderClass}" id="lblOrderClass"/>
                            <p:tooltip for="lblOrderClass" value="#{storeOrder.orderClass}"/>
                        </center>
                    </p:column>
                    <p:column  id="columnRequiredBy" headerText="Requerido Por" sortBy="#{storeOrder.requiredBy}">    
                        <center>
                            <p:outputLabel value="#{storeOrder.requiredBy}" id="lblRequiredBy"/>
                            <p:tooltip for="lblRequiredBy" value="#{storeOrder.requiredBy}"/>
                        </center>
                    </p:column>
                    <p:column filterMatchMode="contains"  filterBy="#{storeOrder.amountItems}"
                              id="columnNumberItems" headerText="No. Items" sortBy="#{storeOrder.amountItems}">    
                        <center>
                            <p:outputLabel value="#{storeOrder.amountItems}" id="lblNumberItems"/>
                            <p:tooltip for="lblNumberItems" value="#{storeOrder.amountItems}"/>
                        </center>
                    </p:column>
                    <p:column id="columnDate" headerText="Fecha" 
                              sortBy="#{scStoreOrderBean.getFormatDateGlobal('yyyyMMdd', storeOrder.creationDate)}">    
                        <center>
                            <p:outputLabel 
                                value="#{scStoreOrderBean.getFormatDateGlobal('dd-MM-yyyy', storeOrder.creationDate)}" 
                                id="lblDate"/>
                            <p:tooltip for="lblDate" 
                                       value="#{scStoreOrderBean.getFormatDateGlobal('dd-MM-yyyy', storeOrder.creationDate)}"/>
                        </center>
                    </p:column>
                    <p:column id="columnState" headerText="Estado" sortBy="#{storeOrder.idState.description}">    
                        <center>
                            <p:outputLabel value="#{storeOrder.idState.description}" id="lblState"/>
                            <p:tooltip for="lblState" value="#{storeOrder.idState.description}"/>
                        </center>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </h:body>
</html>

